package io.renren.service.impl;

import io.renren.dao.ExeclFileDao;
import io.renren.entity.ExeclFileEntity;
import io.renren.service.ExeclFileService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 实现类
 *
 * @author 阿健
 * @create 2017-03-12 22:45
 */
@Service
public class ExeclFileServiceImpl implements ExeclFileService {

    @Autowired
    private ExeclFileDao execlFileDao;

    @Override
    public boolean checkFileIsExiste(String fileName) {
        if (StringUtils.isEmpty(fileName)) {
            return false;
        }
        ExeclFileEntity execlFileEntity = execlFileDao.queryExeclFile(fileName);
        if (execlFileEntity == null) {
            return false;
        } else {
            return true;
        }
    }

    @Override
    public void saveExeclFile(ExeclFileEntity execlFileEntity) {
        execlFileDao.save(execlFileEntity);
    }

    @Override
    public ExeclFileEntity queryExeclFileEntity(String fileName) {
        return execlFileDao.queryExeclFile(fileName);
    }
}
